#include "SmartPtr.h"
using namespace std;

void test_shared_ptr()
{
	size_t n1 = 10000;
	size_t n2 = 10000;
	lzb::shared_ptr<double> sp(new double(1.1));
	mutex mtx;
	thread t1([&]() {
		for (size_t i = 0; i < n1; i++)
		{
			lzb::shared_ptr<double> copy(sp);
		}
		});
	thread t2([&]() {
		for (size_t i = 0; i < n2; i++)
		{
			lzb::shared_ptr<double> copy(sp);
		}
		});
	t1.join();
	t2.join();
	sp.use_count();
}

int main()
{
	test_shared_ptr();
	return 0;
}